import { h } from 'vue';
import { NAvatar } from 'naive-ui';
import { BasicColumn } from '@/components/Table';
export interface ListData {
  id: number;
  title: string;
  cover: string;
  brief: string;
  price: number;
  sort: string;
  clicks: string;
  level: string;
  shop_type_text: string;
  password: string;
  status_text: string;
  created_at: string;
}

export const columns: BasicColumn<ListData>[] = [
  {
    title: '名称',
    key: 'title',
  },
  {
    title: '封面',
    key: 'cover',
    render(record) {
      return h(NAvatar, {
        size: 50,
        src: record.cover,
      });
    },
  },
  {
    title: '金额',
    key: 'price',
  },
  {
    title: '点击量',
    key: 'clicks',
  },
  {
    title: '售卖类型',
    key: 'shop_type_text',
  },
  {
    title: '课程状态',
    key: 'status_text',
  },
  {
    title: '创建时间',
    key: 'created_at',
  },
];
